{template header}
<!--main-->
<div class="midder">


<div id="upgrade" class="update">

</div>

<!--
<div class="patch">
<h1>{$TS_CF[info][version]}系统补丁</h1>
<ul id="patchlist">

</ul>
</div>
-->


</div>
<script src="public/js/jquery.min.js" type="text/javascript"></script>
<script>
//检测是否有升级
function isupdate(version){
	$('#upgrade').html('<img src="public/images/loading.gif" />加载中...');
	$.getJSON("http://www.thinksaas.cn/index.php?app=upcenter&ac=find&version="+version+"&callback=?", function(rs){
		if(rs){
			$('#upgrade').html('<h1>发现新版本：'+rs.upversion+'</h1><div class="uplog">'+rs.uplog.replace(/\n|\r|(\r\n)|(\u0085)|(\u2028)|(\u2029)/g, "<br />")+'</div><div class="uptime">'+rs.uptime+'</div><div class="notice">提示：后台升级只针对用户未做程序改动的ThinkSAAS版本，自行修改过程序的用户谨慎采用此升级方式。<br />升级前请注意备份网站和数据库！</div><div class="upgo"><a href="index.php?app=system&ac=update&ts=one">点击自动升级</a> <a href="index.php?app=system&ac=handup&ts=one">我要手动升级</a></div>');
		}else{
			$('#upgrade').html('<h1>已经是最新版本</h1><div class="uplog">无需升级</div></div>');
		}
	});   
}
isupdate("{$TS_CF['info']['version']}");

$(document).ready(function(){
	$.getJSON("http://www.thinksaas.cn/index.php?app=upcenter&ac=patch&version={$TS_CF['info']['version']}&callback=?", 
	function(data){
		$.each(data, function(i,item){
			$("#patchlist").append("<li>["+item.uptime+"] <a target=\"_blank\" href=\""+item.upurl+"\">"+item.title+"</a></li>");
		});
	});   
});

</script>
{template footer}